package com.xxdy.sqringbootdemo.service.impl;

import com.xxdy.sqringbootdemo.entity.User;
import com.xxdy.sqringbootdemo.service.UserService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service("userService")
public class UserServiceImpl implements UserService {
    Map<Integer,User> userMap = new HashMap<>();
    public UserServiceImpl(){
        User user1 = new User(1,"xxdy","145287","121454@wses.fd");
        User user2 = new User(2,"smcxa","987eew","kkoi@jjd");
        userMap.put(1,user1);
        userMap.put(2,user2);
    }

    @Override
    public User findByUid(Integer uid) {
        return userMap.get(uid);
    }
}
